package cn.yunhe.interceptor;

import java.util.Map;

import javax.servlet.http.HttpSession;

import cn.yunhe.entity.Listuser;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;

public class LoginInterceptor extends MethodFilterInterceptor {
	
	private static final long serialVersionUID = 1L;

	@Override
	protected String doIntercept(ActionInvocation action) throws Exception {
		Map session=action.getInvocationContext().getSession();
		Listuser user=(Listuser)session.get("user");
		if(user==null){
			return "nouser";
		}else{
			return action.invoke();
		}
	}

}
